#if !defined(AFX_TABSWINDOW_H__6A06C13B_4748_11D1_BC91_0000010016A6__INCLUDED_)
#define AFX_TABSWINDOW_H__6A06C13B_4748_11D1_BC91_0000010016A6__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// TabBarsWnd.h : header file
//
#include "Common\TabCtrlEx.h"

/////////////////////////////////////////////////////////////////////////////
// CTabBarsWnd window
#define		TABBAR_WINDOW_TIMERID					0x201

class CCommands;
class BCMenu;

//##ModelId=431C34C70177
class CTabBarsWnd : public CWnd
{
    friend class CTabManagerWindow;

// Construction
public:
	//##ModelId=431C34C70187
    CTabBarsWnd(CCommands* pCommands);

// Attributes
public:
	//##ModelId=431C34C701D5
  CTabCtrlEx          m_TabCtrl;
	//##ModelId=431C34C701D9
  int                 m_iLockUpdates;
	//##ModelId=431C34C701F5
  IApplication *      m_pApplication;
	//##ModelId=431C34C701FA
  CCommands *         m_pCommands;
	//##ModelId=431C34C70213
  int                 m_iMinHeight;
	//##ModelId=431C34C70214
  int                 m_iMinWidth;

	//##ModelId=431C34C70222
	UINT		m_uTimerID;
// Operations
public:
	//##ModelId=431C34C70232
    void UpdateTabs();

//	void Reorder();
//	void Renumber();

	//##ModelId=431C34C70242
    bool GetDocumentObject(CComQIPtr<IGenericWindow, &IID_IGenericWindow> pWindow,
        CComQIPtr<IGenericDocument, &IID_IGenericDocument>& pDoc);

// Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CTabBarsWnd)
	public:
	//##ModelId=431C34C70252
	virtual BOOL DestroyWindow();
	//}}AFX_VIRTUAL

// Implementation
public:
	//##ModelId=431C34C70254
	void SetTabFont(CFont *pFont);
	//##ModelId=431C34C70262
	void ActivateTab(int iIndex);
	//##ModelId=431C34C70281
    virtual ~CTabBarsWnd();

    // Generated message map functions
protected:
	//##ModelId=431C34C7029F
  BOOL LoadPopupMenu(int nResourceID, BCMenu& pMenu, BCMenu *& pPopup);
	//##ModelId=431C34C702C0
	bool FindDSWindow(int iSel, CComQIPtr<IGenericWindow, &IID_IGenericWindow>& pWindow);
	//Fis the bug on "close all except this" menu item
	//##ModelId=431C34C702DE
	void ActivateWindow(CComQIPtr<IGenericWindow, &IID_IGenericWindow>& pWindow, BOOL bActive = TRUE);
	//close a window by IGenericWindow object
	//##ModelId=431C34C702EE
	void CloseDSWindow(CComQIPtr<IGenericWindow, &IID_IGenericWindow>& pWindow);

    //{{AFX_MSG(CTabBarsWnd)
	//##ModelId=431C34C702FE
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	//##ModelId=431C34C8001F
	afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
	//##ModelId=431C34C8007D
	afx_msg void OnDestroy();
	//##ModelId=431C34C8009C
	afx_msg void OnPaint();
	//##ModelId=431C34C800AB
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	//##ModelId=431C34C800BC
	afx_msg void OnSelchangeTabCtrl(NMHDR* pNMHDR, LRESULT* pResult);
	//##ModelId=431C34C800EA
	afx_msg void OnToolTipTabCtrl  (NMHDR* pNMHDR, LRESULT* pResult);
	//##ModelId=431C34C80119
	afx_msg void OnRClickTabCtrl   (NMHDR* pNMHDR, LRESULT* pResult);
	//##ModelId=431C34C80148
	afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
	//##ModelId=431C34C80159
	afx_msg void OnDbClickTabCtrl(int nTabIdx,LPARAM lParam);
	//##ModelId=431C34C80186
DECLARE_MESSAGE_MAP();

	//##ModelId=431C34C80188
	CFont					*m_pFont;
	//##ModelId=431C34C80197
  CImageList    m_TabImages;
	//##ModelId=431C34C801A5
  CRect         m_RectGripper;

	//##ModelId=431C34C80203
  struct tabdata_t
  {
		//##ModelId=431C34C80222
      HWND    hWnd;       // corresponding window
		//##ModelId=431C34C80223
      CString cPath;      // window title (file path)
//        int     iNumber;    // displayed tab number
		//##ModelId=431C34C80224
      int     iIndex;     // index in tab control
		//##ModelId=431C34C80232
      BOOL    bVerified;  // for internal list keeping
  };

	//##ModelId=431C34C801B5
	tabdata_t * GetTabData(int iTabIndex);

	//##ModelId=431C34C801D7
	CTypedPtrMap<CMapPtrToPtr, HWND, tabdata_t *> m_TabData;
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_TABSWINDOW_H__6A06C13B_4748_11D1_BC91_0000010016A6__INCLUDED_)
